<?php
$this->headLink()
    ->appendStylesheet('extjs/resources/css/ext-all.css');

$this->headScript()
    //->appendFile('extjs/adapter/ext/ext-base.js')
    //->appendFile('extjs/ext-all.js')
    ->appendFile('extjs/ext.js')
    ->appendFile('js/users-grid.js')
    //->appendFile('js/flashmessage.js')
    ;
?>

<? $this->headTitle('Users'); ?>
<? $this->placeholder('title')->set('Users'); ?>

<p>
    <a href="<?php echo $this->url(array('controller'=>'users', 'action'=>'add')); ?>">Add New User</a>
</p>
<dl class="zend_form">
<?php echo $this->groupSelect; ?>
</dl>

<div id="user-grid"></div>

<?php $this->headScript()->captureStart() ?>
jQuery(document).ready(function(){
    jQuery('#group_id').change(function(){
        reloadGrid(jQuery(this).val());
    });
    reloadGrid(0);
});
<?php $this->headScript()->captureEnd(); ?>